package oa.hleast.xswl.common.enums;

import io.swagger.annotations.ApiModel;
import lombok.Getter;

@Getter
@ApiModel("抽奖奖品枚举")
public enum LotteryEnum {
    NULL(0),  // 空
    POINT(1),  // 积分
    COUPON(2); // 优惠券

    private Integer code;

    LotteryEnum(Integer code) {
        this.code=code;
    }

    public static LotteryEnum getValue(Integer code){
        for (LotteryEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
